/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.qsoft.entity.model;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.qsoft.entity.Usuario;

/**
 *
 * @author AngelQuingaluisa
 */
@Stateless
public class UsuarioFacade extends AbstractFacade<Usuario> {

    @PersistenceContext(unitName = "crudPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public UsuarioFacade() {
        super(Usuario.class);
    }

    public Usuario findUsuario(String cedula) {
        Usuario usr = null;
        try {
            usr= (Usuario) em.createQuery("select object(o) from Usuario as o where o.cedula = '" + cedula + "'").getSingleResult();
   
        } finally {
            return usr;
        }
        
    }
}
